/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model.visitor;

/**
 *
 * @author Tam
 */
public class VIPVisitor extends Visitor{
    
    public VIPVisitor(int number, int money){
        super(number,money);
    }
    
    @Override
    public void run(){
        System.out.println("VIP Visitor " + getNumber() +" with $" + getMoney() +" is created...");
        try{
            for (int i=1; i< 100; i++){
                Thread.sleep(20*1000);
                spendMoney();
                
            }
        
        } catch (Exception e){
        }
    }

    @Override
    public void spendMoney() {
        if (getMoney()>75){
            setMoney(getMoney() - 75);
            System.out.println("VIP Visitor " + getNumber() +" spent $75...Money is now " + getMoney());
        }
        else System.out.println("VIP Visitor " + getNumber() +" doesnot have enough money to spend...Money is now " + getMoney());
     
    }
    
}
